package com.fingard.dsp.bank.reqrespobj.elecbillquery;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.elecbillquery.detail.RetAtsB002BillTransQryDetail;
import com.fingard.xml.XmlTextWriter;

/**
 * Created by dell on 2017/10/31.
 */
public class RetAtsB002BillTransQry extends RetAtsBase {
    public String respCode;
    public String respInfo;

    public RetAtsB002BillTransQry(ReqRespHeader p_header) {
        retHeader = p_header;
        retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
    }

    public void writeBefore() {
        writeStart();//写返回ATS的统一头部信息
        retXmlWriter.writeElementString("respCode", respCode);
        retXmlWriter.writeElementString("respInfo", respInfo);
    }

    public void writeAfter() {
        writeEnd(); //写结束
    }

    public void writeDetail(RetAtsB002BillTransQryDetail DB002Resp) throws Exception {
        retXmlWriter.writeStartElement("DetailRecord");
        retXmlWriter.writeElementString("BillNo", DB002Resp.billNo);
        retXmlWriter.writeElementString("BillType", DB002Resp.billType);
        retXmlWriter.writeElementString("BusiType", DB002Resp.busiType);
        retXmlWriter.writeElementString("QueryType", DB002Resp.queryType);
        retXmlWriter.writeElementString("TransFlag", DB002Resp.transFlag);

        retXmlWriter.writeElementString("ApplyDate", DB002Resp.applyDate);
        retXmlWriter.writeElementString("RespDate", DB002Resp.respDate);
        retXmlWriter.writeElementString("ApplyName", DB002Resp.applyName);
        retXmlWriter.writeElementString("ApplyCode", DB002Resp.applyCode);
        retXmlWriter.writeElementString("ApplyAct", DB002Resp.applyAct);

        retXmlWriter.writeElementString("ApplyBnkName", DB002Resp.applyBnkName);
        retXmlWriter.writeElementString("ApplyBnkCode", DB002Resp.applyBnkCode);
        retXmlWriter.writeElementString("ReceName", DB002Resp.receName);
        retXmlWriter.writeElementString("ReceCode", DB002Resp.receCode);
        retXmlWriter.writeElementString("ReceAct", DB002Resp.receAct);

        retXmlWriter.writeElementString("ReceBnkName", DB002Resp.receBnkName);
        retXmlWriter.writeElementString("ReceBnkCode", DB002Resp.receBnkCode);
        retXmlWriter.writeElementString("Memo", DB002Resp.memo);
        retXmlWriter.writeElementString("ContractNo", DB002Resp.contractNo);
        retXmlWriter.writeElementString("InvoiceNo", DB002Resp.invoiceNo);

        retXmlWriter.writeElementString("GuarAddr", DB002Resp.guarAddr);
        retXmlWriter.writeElementString("DiscType", DB002Resp.discType);
        retXmlWriter.writeElementString("PayType", DB002Resp.payType);
        retXmlWriter.writeElementString("RepOpenDate", DB002Resp.repOpenDate);
        retXmlWriter.writeElementString("RepDueDate", DB002Resp.repDueDate);

        retXmlWriter.writeElementString("DiscRate", DB002Resp.discRate);
        retXmlWriter.writeElementString("DiscAmt", DB002Resp.discAmt);
        retXmlWriter.writeElementString("RepRate", DB002Resp.repRate);
        retXmlWriter.writeElementString("RepAmt", DB002Resp.repAmt);
        retXmlWriter.writeElementString("ProPayAmt", DB002Resp.proPayAmt);
        retXmlWriter.writeElementString("ActedAct", DB002Resp.actedAct);

        retXmlWriter.writeElementString("ActedBnkCode", DB002Resp.actedBnkCode);
        retXmlWriter.writeElementString("UnPayCode", DB002Resp.unPayCode);
        retXmlWriter.writeElementString("GuarType", DB002Resp.guarType);
        retXmlWriter.writeElementString("OverDueRea", DB002Resp.overDueRea);
        retXmlWriter.writeElementString("RecourseType", DB002Resp.recourseType);

        retXmlWriter.writeElementString("RecourseAmt", DB002Resp.recourseAmt);
        retXmlWriter.writeElementString("RecourseCode", DB002Resp.recourseCode);
        retXmlWriter.writeEndElement();
    }
}
